function checkMobile(val)
{
	var patt = /^1[0-9]{10}$/;
	return patt.test(val);
}

function checkPwd(val)
{
	if(val.length<6||val.length>12){
		return false;
	}else{
		var patt =  /^[^\u4e00-\u9fa5]{6,12}$/;
		return patt.test(val);
	}
}

function autoSize(obj,max)
{	
	var o = $(obj);
	o.removeAttr("height");
	o.removeAttr("width");
	var h = o.height();
	var w = o.width();
	var r = 0;
	if(h>w)
	{
			if(h <= max)
			{
					return;
			}
			else
			{
				r = h/max;
				h = max;
				w = parseInt(w/r);
			}
	}
	else
	{
			if(w <= max)
			{
				return;
			}
			else
			{
				r = w/max;
				w = max;
				h = parseInt(h/r);
			}
	}
	o.attr("height",h);
	o.attr("width",w);
}

var isNum = function(str) {
	if($.trim(str) == ""){
		return false;
	}
	return !isNaN($.trim(str));
}

var isInt = function(str) {
	return /^\d+$/.test(str);
}

var isVoltage = function(str){
	return /^\d+[kK]?[vV]$/.test(str);
}

var validateInt = function(str){
	return str==""||isInt(str);
}
var validateNum = function(str){
	return str==""||isNum(str);
}
var isRatio = function(str){
	var exp=/^\d+([.]+\d)?\/\d+([.]+\d)?$/;
	return exp.test(str);
}